package caculate.strSearch;

/**
 * @program: rocsun
 * @description:
 * @author: yx.guo
 * @create: 2025-02-28 12:32
 **/
public class ThreeMethSearchStr {

    public static void main(String[] args) {
        String str = "sadbutsad";
        String pattern = "sad";

//        str = "ABABABC";
//        pattern = "ABC";

        // KMP算法
        StrMethod kmp = new KMP(str, pattern);
        System.out.println(kmp.search());

        // Sunday算法
        StrMethod sunday = new Sunday(str, pattern);
        System.out.println(sunday.search());

        // Boyer-Moore算法
        StrMethod boyerMoore = new BM(str, pattern);
        System.out.println(boyerMoore.search());

    }

}
